# 定义装饰器
import logging
logging.basicConfig(level=logging.INFO)

def loggingDecorator(func):
    """记录日志的装饰器"""
    def wrapperLogging(*args, **kwargs):
        logging.info("开始执行%s()..." % func.__name__)
        func(*args, **kwargs)
        logging.info("%s()执行完成！" % func.__name__)
    return wrapperLogging

def showInfo(*args, **kwargs):
    print("这是一个测试函数，参数：", args, kwargs)


decoratedShowInfo = loggingDecorator(showInfo)
decoratedShowInfo('arg1', 'arg2', kwarg1 = 1, kwarg2 = 2)